FROM registry.cn-hangzhou.aliyuncs.com/vikingsoft/jdk17:latest
RUN rm -rf /etc/localtime
RUN ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
ENV TZ="Asia/Shanghai"
# 设置工作目录
WORKDIR /

# 构建时传入的参数
# 要复制进docker镜像的jar包目录
ARG JAR_FILE
COPY $JAR_FILE app.jar

# docker run 时可传入的参数
# 服务端口号
ENV SERVER_PORT=8080
# spring boot 启动参数
ENV COMMAND_LINE_PARAMETER=""

ENTRYPOINT ["sh","-c","java -Djava.security.egd=file:/dev/./urandom -Duser.timezone=GMT+08 -Dfile.encoding=utf-8 -Dserver.port=${SERVER_PORT} -jar ./app.jar ${COMMAND_LINE_PARAMETER}"]